//
//  ShapeFactory.swift
//  FactoryPattern
//
//  Created by 好米有易 on 2017/12/12.
//  Copyright © 2017年 好米有易. All rights reserved.
//

import UIKit

class ShapeFactory {

    func getShape(shapeType: String) -> Shape {
        
        if shapeType == "CIRCLE" {
            
            return Circle()
            
        }
        
        if shapeType == "RECTANGLE" {
            
            return Rectangle()
            
        }
        
        if shapeType == "SQUARE" {
            
            return Square()
            
        }
        
        
        return Circle();
    }
    
}
